<?php

$id = $_GET['id'];

include("pdo.php");


$sql = "select * from articles where id=:id";

$stmt = $pdo->prepare($sql);
$stmt->bindParam(":id", $id);

$stmt->execute();

// 获取一个文章
$article = $stmt->fetch();

// print_r($article);
?>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title><?=$article['title']?></title>
</head>
<body>
	<h1><?=$article['title']?></h1>
	<div><?=$article['ctime']?></div>
	<div><?=$article['content']?></div>
</body>
</html>

